var aA = document.querySelectorAll(".nav>li>a");
var aUl = document.querySelectorAll(".min-nav");
// 左边的下拉菜单

for (var i = 0; i < aA.length; i++) {
  aA[i].onclick = function () {
    var oUl = this.nextElementSibling;
    if (getComputedStyle(oUl).height == "0px") {
      for (var j = 0; j < aUl.length; j++) {
        aUl[j].style.height = "0px";
        aA[j].className = "";
      }
      oUl.style.height =
        oUl.children[0].scrollHeight * oUl.children.length + "px";
      this.className = "active";
    } else {
      oUl.style.height = "0px";
    }
  };
}
//日期选择
var date = new Date()
var yyyy = date.getFullYear()
var MM = (date.getMonth() + 1) < 10 ? ("0" + (date.getMonth() + 1)) : (date.getMonth() + 1)
var dd = date.getDate() < 10 ? ("0" + date.getDate()) : date.getDate()
var HH = date.getHours() < 10 ? ("0" + date.getHours()) : date.getHours()
var mm = date.getMinutes() < 10 ? ("0" + date.getMinutes()) : date.getMinutes()

var curDay = yyyy + '-' + MM + '-' + dd + 'T' + HH + ':' + mm;
$('.measureDate').val(curDay)

//图表
//初始化echarts实例
var myChart = echarts.init(document.getElementById("main"));
// 指定图表的配置项和数据
option = {
  tooltip: {
    trigger: "item",
  },
  legend: {
    top: "5%",
    left: "center",
  },
  series: [
    {
      type: "pie",
      radius: ["55%", "70%"],
      avoidLabelOverlap: false,
      label: {
        show: false,
        position: "center",
      },
      emphasis: {
        label: {
          show: true,
          fontSize: "40",
          fontWeight: "bold",
        },
      },
      labelLine: {
        show: false,
      },
      data: [
        { value: 4544, name: "审批数" },
        { value: 2635, name: "出库数" },
        { value: 1841, name: "归还数" },
      ],
    },
  ],
};
// 使用刚指定的配置项和数据显示图表。
myChart.setOption(option);
var myChart = echarts.init(document.getElementById("main2"));

// 指定图表的配置项和数据
option = {
  tooltip: {
    trigger: "item",
  },
  legend: {
    top: "5%",
    left: "center",
  },
  series: [
    {
      type: "pie",
      radius: ["55%", "70%"],
      avoidLabelOverlap: false,
      label: {
        show: false,
        position: "center",
      },
      emphasis: {
        label: {
          show: true,
          fontSize: "40",
          fontWeight: "bold",
        },
      },
      labelLine: {
        show: false,
      },
      data: [
        { value: 4544, name: "待审批" },
        { value: 2635, name: "审批通过" },
        { value: 1841, name: "审批不通过" },
      ],
    },
  ],
};
// 使用刚指定的配置项和数据显示图表。
myChart.setOption(option);

var myChart = echarts.init(document.getElementById("main3"));
//初始化echarts实例
option = {
  xAxis: {
    type: "category",
    data: ["2022-07-01", "2022-07-02", "2022-07-03", "2022-07-04", "2022-07-05", "2022-07-06", "2022-07-07"],
  },
  yAxis: {
    type: "value",
  },
  series: [
    {
      data: [300, 500, 1400, 1100, 1290, 1320, 1500],
      type: "line",
      smooth: true,
    },
  ],
};
 // 使用刚指定的配置项和数据显示图表。
 myChart.setOption(option);